//
//  HKListSectionModel.h
//  KSBridgeDesign
//
//  Created by huzhaoke on 2021/4/17.
//

#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>
#import "HKSectionHeaderFooterViewModel.h"
#import "HKListCellModel.h"

NS_ASSUME_NONNULL_BEGIN

@interface HKListSectionModel : NSObject

@property (nonatomic, readonly) NSMutableArray<HKListCellModel *> *cellModels;

@property (nonatomic, strong) HKSectionHeaderFooterViewModel *headerViewModel;
@property (nonatomic, strong) HKSectionHeaderFooterViewModel *footerViewModel;

+ (instancetype)sectionModelWithCellModels:(HKListCellModel *)cellModels;

- (BOOL)isEmpty;
- (NSInteger)cellModelCount;
- (NSInteger)totalCellHeight;
- (nullable __kindof HKListCellModel *)cellModelAtIndex:(NSUInteger)index;

- (void)clear;
- (void)addCellModel:(HKListCellModel *)cellModel;
- (void)addCellModels:(NSArray<HKListCellModel *> *)cellModels;
- (void)insertCellModel:(HKListCellModel *)cellModel atIndex:(NSInteger)index;
- (void)insertCellModels:(NSArray<HKListCellModel *> *)cellModels atIndex:(NSInteger)index;
- (void)removeCellModel:(HKListCellModel *)cellModel;
- (void)removeCellModels:(NSArray<HKListCellModel *> *)cellModels;
- (void)removeCellModelAtIndex:(NSInteger)index;
- (BOOL)containsCellModel:(HKListCellModel *)cellModel;

//  Reload
- (void)reload;
- (void)reloadWithAnimation:(UITableViewRowAnimation)animation;

- (NSIndexPath *)sectionIndexPath;
- (NSUInteger)indexOfCellModel:(HKListCellModel *)cellModel;

@end

NS_ASSUME_NONNULL_END
